Brad Fults
1p1 comments posted · 0 followers · following 0
16 years ago @ Union Station - Rails and Merb Merge: ... · 0 replies · +1 points
What if you partitioned the @collection by type such that you could determine the template to render with up front (for each segment)? You could loop over the segments and, for each type, run your existing loop to call render(). This would presumably incur an up-front O(n) penalty for the partition() call, but I imagine that being faster than doing the type-to-template conversion for every element in the collection.